/**
 * Created by jrocha on 9/18/14.
 */
public class Seventh {
    public Seventh(String message, String name){
        this.message = message;
        this.name = name;
    }

    public void printMessage(){
        System.out.print(message);
    }

    public void printLine(int times){
        for (int count = 0; count < times; ++count){
            printMessage();
        }
    }

    public void printWhiteSpaces(int times){
        for (int count = 0; count < times; ++count){
            System.out.print(" ");
        }
    }

    public int printTriangleUp(int times){
        int countChar = 1;
        int countWhiteSpaces = times - 1;
        for (int countLine = 1; countLine <= times-1; ++countLine){
            printWhiteSpaces(countWhiteSpaces);
            printLine(countChar);

            countChar += 2;
            --countWhiteSpaces;
            System.out.println("");
        }

        return countChar - 2;
    }

    public void printTriangleDown(int times, int countChar){
        int countWhiteSpaces = 1;
        for (int countLine = 1; countLine <= times; ++countLine){
            printWhiteSpaces(countWhiteSpaces);
            printLine(countChar);

            countChar -= 2;
            ++countWhiteSpaces;
            System.out.println("");
        }
    }

    public void printDiamond(int times){
        int countChar = printTriangleUp(times);
        System.out.println(name);
        printTriangleDown(times, countChar);

        System.out.println("");
    }

    private String message;
    private String name;
}
